package com.czbank.financing.mapper;

import com.czbank.financing.Entity.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import javax.annotation.Resource;

/**
 * @Auther: thinkpad
 * @Date: 2019/7/11 11:46
 * @Description:
 */
@Resource(name="loginMapper")
public interface LoginMapper {
    @Select("SELECT count(*) FROM user_info WHERE account = #{account}")
    public int existAccount(@Param("account") String account);

    @Select("SELECT * FROM user_info WHERE account = #{account} and password=#{password}")
    public UserInfo findByAccountAndPassword(@Param("account")String account, @Param("password") String password);

    @Insert("insert into * FROM user_info WHERE account = #{account} and password=#{password}")
    public boolean InsertUserInfo(@Param("account")String account, @Param("password") String password);

}
